home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / ARTOOL.ARJ / ART.C next >
Text File  |  1991-12-03  |  1KB  |  49 lines

  1. #include <graphics.h>
  2.  
  3. /*
  4.    These routines are used to draw the polygon shapes that ARTOOL
  5.    produces.
  6.  
  7.    Please compile and link into your own routines.
  8.  
  9.    CopyRight (C) 1991 SunSet Software,34 Ridge Rd,Oak Ridge,NJ 07348
  10. */
  11.  
  12. void ArtFillPoly(int X,int Y,int NumVertices,int Vertices_xy[])
  13. {
  14.    int points[100*2],i;
  15.  
  16.    if(!NumVertices)
  17.       return;
  18.  
  19.    for(i=0;i<NumVertices*2;i=i+2)
  20.    {
  21.       points[i]   = Vertices_xy[i]+X;
  22.       points[i+1] = Vertices_xy[i+1]+Y;
  23.    }
  24.    points[NumVertices*2] = points[0];
  25.    points[NumVertices*2+1] = points[1];
  26.  
  27.    fillpoly(NumVertices+1,points);
  28.  
  29. }
  30. void ArtDrawPoly(int X,int Y,int NumVertices,int Vertices_xy[])
  31. {
  32.    int points[100*2],i;
  33.  
  34.    if(!NumVertices)
  35.       return;
  36.  
  37.    for(i=0;i<NumVertices*2;i=i+2)
  38.    {
  39.       points[i]   = Vertices_xy[i]+X;
  40.       points[i+1] = Vertices_xy[i+1]+Y;
  41.    }
  42.    points[NumVertices*2] = points[0];
  43.    points[NumVertices*2+1] = points[1];
  44.  
  45.    drawpoly(NumVertices+1,points);
  46.  
  47. }
  48.  
  49.